package com.qf.ks.controller;

import com.qf.ks.dto.R;
import com.qf.ks.pojo.Authors;
import com.qf.ks.service.AuthorsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/author")
public class AuthorsController {
    @Autowired
    private AuthorsService authorsService;
    @PostMapping("/newauthor")
    public R AddAuthors(@RequestBody Authors authors){
        authorsService.AddAuthors(authors);
        return R.setOk(authors);
    }
}
